package com.dc.entity.special;

import com.dc.entity.ShipRepairEntity;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.persistence.*;
import java.util.Date;

/**
 *  3 机电管子焊接 亚善-康帝
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@Entity
@Table(name = "t_workflow_special_1_machine_pipe")
public class WorkflowSpecial1MachinePipeEntity {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;

    @Column(name = "ship_repair_id", columnDefinition = "bigint unsigned NOT NULL", insertable = false, updatable = false)
    private Long shipRepairId;      // 维修记录 外键id

    @Column(name = "submit_time")
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date submitTime;        // 填写日期

    @Column(name = "ship_name", length = 50)
    private String shipName;        // 船体名称

    @Column(name = "reporter", length = 20)
    private String reporter;        // 填报人

    ////////////////////////////////////////////////////////////////////////
    @Column(name = "device", length = 50)
    private String device;          // 部件

    @Column(name = "diam")
    private Double diam;            // 直径(mm)

    @Column(name = "zg_num")
    private Integer zgNum;          // 直管数量

    @Column(name = "wg_num")
    private Integer wgNum;          // 弯管数量

    @Column(name = "fl_num")
    private Integer flNum;          // 法兰数量

    @Column(name = "tg_num")
    private Integer tgNum;          // 套管数量

    @Column(name = "fl_length")
    private Double flLength;        // 法兰长度

    @Column(name = "wg_length")
    private Double wgLength;        // 弯管长度

    @Column(name = "wg_hf_length")
    private Double wghfLength;        // 弯管焊缝长度

    @Column(name = "wg_power_by_unit")
    private Double wgPowerByUnit;     // 弯管单位耗电量标定值

    @Column(name = "wg_power")
    private Double wgPower;           // 弯管耗电量

    @Column(name = "fl_hf_length")
    private Double flhfLength;        // 法兰焊缝长度

    @Column(name = "fl_power_by_unit")
    private Double flPowerByUnit;     // 法兰单位耗电量标定值

    @Column(name = "fl_power")
    private Double flPower;           // 法兰耗电量

    ////////////////////////////////////////////

    @JsonIgnore
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "ship_repair_id")
    private ShipRepairEntity shipRepairEntity;

}
